function disp_graph(graph,type)
    if nargin ~= 2
        disp('wrong number of input arguments.')
        disp('Graph is not displayed.')
        return
    end
    if sum(type~=[1,2,3])~=2
        disp('wrong type of graph.')
        disp('Graph is not displayed.')
        return
    end
    if (type == 3)
        flag = 'on';
    else
        flag = 'off';
    end
    view(biograph(graph,[],'ShowArrows',flag,'ShowWeights','on'));
end